package com.takeoff.iot.modbus.netty.data.factory;

import com.takeoff.iot.modbus.common.bytes.factory.ModbusDataFactory;
import com.takeoff.iot.modbus.common.data.MeterModbusData;
import com.takeoff.iot.modbus.common.data.ModbusData;
import com.takeoff.iot.modbus.common.message.ModbusMessage;
import com.takeoff.iot.modbus.common.message.ModbusMessage;

public class ModbusClientDataFactory implements ModbusDataFactory {

	@Override
	public ModbusData buildData(int command, byte[] datas) {
		ModbusData data = null;
		switch (command) {
			case ModbusMessage.READ:
//				data = new MeterModbusData(datas);
//				break;
			case ModbusMessage.WRITE:
//				data = new MeterModbusData(datas);
//				break;
			default:
				data = new MeterModbusData(datas);
			break;
		}
		return data;
	}

}
